<div id="content">
                    	<h3>Sửa danh mục</h3>
                        
                        <a class="back" href="<?php echo base_url() ?>index.php/Quanlydanhmuc/index">Quay lại</a>
                            
                        <div id="contentFunc">
							  <?php 
                                  $attributes = array('id'=>'frmCapNhatDM','name'=>'frmCapNhatDM','enctype'=>'multipart/form-data');
                                  echo form_open_multipart('Quanlydanhmuc/sua/'.$danhmuc['madm'],$attributes);
                              ?>
                              
                              <div class="blockSP">
                                <label class="lblDanhMuc" for="txtTenDM">Tên danh mục:</label>
                                <input class="input" type="text" id="txtTenDM" name="tendanhmuc" value="<?php echo $danhmuc['tendanhmuc']?>"/>
                              </div>
                              
                              <div class="blockSP">
                                <label class="lblDanhMuc">Hình:</label>
                                <input class="input" type="file" id="fileHinhDM" name="fileHinhDM"/>
                              </div>
                              
                              <div class="img">
                              	<img src="<?php echo base_url().$danhmuc['hinh']?>" alt="Hình danh mục"/>
                              </div>
                              
                              <div class="blockSP">
                                <label class="lblDanhMuc" for="txtTenDMEn">Tên danh mục tiếng anh:</label>
                                <input class="input" type="text" id="txtTenDMEn" name="tendanhmuc_en" value="<?php echo $danhmuc['tendanhmuc_en']?>"/>
                              </div>
                              
                              <div class="blockSP">
                                <label class="lblDanhMuc" >Danh mục:</label>
                                <?php 
									if(isset($danhmucs))
									{
										if(is_array($danhmucs))
										{
											$options = array();
											$options['0'] = "Null";
											foreach ($danhmucs as $item)
											{
												$options[$item['madm']] = $item['tendanhmuc'];
											}
											if(isset($danhmuc['madm_cha']))
											{
												echo form_dropdown('madm_cha',$options,$danhmuc['madm_cha']); 
											}
											else
											{
												echo form_dropdown('madm_cha',$options);
											}
										}
									}	
								?>
                             
                              </div>
                              
                             <div class="thongbao_err">
								  <?php 
                                    echo validation_errors();
                                    if(!empty($img['error_upload']))
                                    {
                                        echo $img['error_upload'];
                                    }
                                    
                                    if(!empty($thongbao))
                                    {
                                        echo $thongbao;
                                    }				
                                  ?>
                              </div>
                              
                              <div class="blockSP button">
                              	<input type="submit"  id="btnSuaDM" value="Lưu" />
                				<input type="reset" name="btnHuyBo" id="btnHuyBo" value="Hủy bỏ" />
                              </div>
                           </form>
                        </div>
                    </div>
            </div>